1. Field of the Invention
The present invention relates to communication systems, and more particularly, to communications for computers.
2. Description of the Related Art
As computers have become ubiquitous, the usefulness of the computers has increased by interconnecting them with other computers. To take advantage of the existing analog telephone network, modems were developed to facilitate transmission between computers via conventional telephone connections. Initially, modems were strictly passive devices connected to a port on a host computer and could modulate data sent from the host computer and demodulate data received over the telephone lines. As modem technology advanced, microcontroller units (MCUs) were added to modems. Many of the configuration and control functions previously performed by the host computer were assumed by the MCU, such as initiating a call, dialing a number, recognizing busy tones, and the like.
The addition of the MCU, however, did not eliminate the need for the host computer to direct the modem operations. Modems typically cannot determine which telephone number to call, whether to answer an incoming call, which data transmission speed may be desired, and many other parameters; the host computer directs these functions via commands sent to the modem.
Conventional modems provide only two physical links to the host computer, one for transmitting and the other for receiving. Consequently, command information for controlling the modem is transmitted over the same link as data information to be transmitted to the destination, and is commonly interspersed with such data information.
A modem typically operates in transmission mode, in which information received by the modem is transmitted to the destination. To process command information, the modem switches to a command mode. One approach to signaling the modem to switch to command mode is to send an escape sequence. In this approach, the MCU checks every character sent from the host computer for the presence of the escape sequence. If detected, the modem enters command mode, processing all data as commands until receipt of a carriage return, signifying the end of the commands. The modem then returns to transmission mode and resumes checking every character until another escape sequence is detected. This approach, however, is susceptible to false detections of an escape sequence because a block of text may include the characters corresponding to the escape sequence.
Another approach to discriminating commands from message data is disclosed in U.S. Pat. No. 4,549,302, issued to Dale A. Heatherington, on Oct. 22, 1985. The Heatherington patent discloses an escape sequence which utilizes a string of predetermined characters (in this case xe2x80x9c+++xe2x80x9d) to signal the modem to enter command mode. The Heatherington approach also requires a one second pause before and after the xe2x80x9c+++xe2x80x9d escape sequence to create a generally acceptable method of detecting commands when used in conjunction with low data transmission rates. However, for high data rates, a two-second delay may result in significant delays.
Another approach used to determine when a modem should switch from transmission mode to command mode is the Timing Independent Escape Sequence (TIES) system. Under TIES, illustrated in FIG. 1, the MCU analyzes the data stream as it passes through the modem until it detects the first character of an escape sequence (step 1). Upon detecting the first character, such as xe2x80x9c+xe2x80x9d for a xe2x80x9c+++xe2x80x9d escape sequence, the MCU waits (step 2) and checks the next character (step 3) to see if it is the second character of the escape sequence. If the second character is not a xe2x80x9c+xe2x80x9d, the MCU waits for the next character (step 0) and resumes checking the data stream. If the second character is a xe2x80x9c+xe2x80x9d, the MCU waits (step 4) and checks the third character (step 5). If the third character is a xe2x80x9c+xe2x80x9d, a portion of the escape sequence has been received, and the MCU starts a timer (step 6). The MCU then waits for either another character to be sent or for the timer to expire (step 7). If another character is sent prior to time running out (step 8), the MCU checks whether the character is an xe2x80x9cAxe2x80x9d, the first character of any valid conventional xe2x80x9cATxe2x80x9d command. If the character is not an xe2x80x9cAxe2x80x9d, the following data is not a command and is processed as data information.
Assuming additional characters are not sent prior to the timer expiring (step 7), the MCU waits for the timer to expire (step 8), sends the confirmation xe2x80x9cOKxe2x80x9d signal (step 9), and waits for the next character (step 10). If a valid escape sequence was sent, the next character sent by the host computer should be an xe2x80x9cAxe2x80x9d (step 11), followed by a xe2x80x9cTxe2x80x9d (step 13). Thus, the MCU, checks every character for the escape sequence. Consequently, with the high data rates utilized in modern modems, TIES may overwork the MCU and significantly degrade modem performance.
For the host computer, checking all the data coming from the modem for commands, responses to commands, and the like is normally acceptable because the host computer""s operating speed is significantly faster than the modem""s. For example a Pentium(trademark) operating at 200 MHz operates at a much higher speed than a modem transferring data at 56.6K bps. For the modem, however, checking all the data coming from the computer for commands may degrade performance.
This is especially true in host provider systems wherein a host computer may be connected at any time to a plurality of remote users. For example, a modem may provide multiple physical channels for data transmission. The host computer may be connected to the multichannel modem via a single bus, for example using time division multiplexing or multiple logical channels. The data rate between the modem and the host computer is typically significantly higher than the data rate through each of the individual physical channels. Checking each character received from the host computer to verify whether it is an escape sequence may significantly degrade the modem""s performance or require an extremely fast, and therefore costly, MCU.
A communication system according to various aspects of the present invention implements a system for reducing the processing burden of detecting an escape sequence in a modem. The communication system monitors the quantity of data contained within the modem""s data buffer. While the quantity of data remains above a selected threshold, the data is not checked for an escape sequence. When the quantity of data falls below the threshold, the modem initiates an escape sequence detection procedure. Because the data source waits for a confirmation signal from the modem after sending the escape sequence, additional data is not received in the data buffer. Consequently, the escape sequence is typically among the most recently received data in the data buffer. As the modem processes the data in the buffer, the quantity falls below the threshold, activating the escape sequence detection procedure. When the escape sequence is identified, the modem enters command mode.